﻿using UnityEngine;

namespace ProjectDanmaku.Util
{
    public static class ColorPacker
    {
        public static int PackColor(Color color)
        {
            int r = (int)(color.r * 255),
                g = (int)(color.g * 255),
                b = (int)(color.b * 255),
                a = (int)(color.a * 255);
            
            return ((r & 0xff) << 24) + ((g & 0xff) << 16) + ((b & 0xff) << 8) + (a & 0xff);
        }
    }
}